package com.example.wanbaqian.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.wanbaqian.R;
import com.example.wanbaqian.base.BaseActivity;
import com.example.wanbaqian.utils.ActivityManagerUtils;
import com.example.wanbaqian.utils.SPUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 注册成功界面
 */
public class RegisteSuccessActivity extends BaseActivity {

    @BindView(R.id.reg_successBtn)
    Button regSuccessBtn;
    private String bean;

    @Override
    protected int getLayout() {
        return R.layout.activity_registe_success;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        setStatusBarColor(R.color.colorBackground);
        setToolBar("注册成功");
        bean = getIntent().getExtras().getString("userInfo");
        mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void initDate() {

    }

    @OnClick({R.id.toolbar, R.id.reg_successBtn})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.reg_successBtn:
                SPUtils.setUserInfo(mContext, bean);
                ActivityManagerUtils.getInstance().finishActivityclass(LoginActivity.class);
                ActivityManagerUtils.getInstance().finishActivityclass(RegisterActivity.class);
                openActivity(HomeActivity.class);
                finish();
                break;
        }
    }
}
